<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/include/header.jsp"%>
<script src="${ctx}/component/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<style type="text/css">
.input_txt{
	width: 100px;
}
</style>
</head>
<body>
	<div class="dialog_main">
		<div class="b_box" style="padding: 25px 10px 10px 10px">
			<form id="jieZhangForm" action="post">
				<input type="hidden" name="CSRFToken" value="${csrfToken}" />
				<table class="c_table">
					<tr>
						<td class="t_tit t_r">[ 请确认要结账到 ]：</td>
						<td>
							<input type="hidden" name="jzYear" value="${year}" />
							<input type="hidden" name="jzMonth" value="${month}" />
							<select class="input_txt">
								<option value="${year}年${month}月">${year}年${month}月</option>
							</select>
						</td>
						<td><input type="button" class="f_btn" id="addBtn" value="确认结账" /></td>
					</tr>
				</table>			
			</form>
		</div>
	</div>

	<script type="text/javascript">
		// 注册保存按钮事件
		$("#addBtn").click(function() {
			if (confirm('确定提交？')) {
				// 序列化表单参数
				var serializedForm = $("#jieZhangForm").serialize();
				$.post("${ctx}/jieZhang/add", serializedForm, function(result) {
					if ("succ" == result) {
						alert("操作成功");
						parent.Hui_admin_tab($(".Hui-aside a[data-title=结账]", parent.document));
						var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);
					} else if ("notThroughSecurityCheck" == result["isThroughSecurityCheck"]) { // 如果不通过安全检查
						var mess = result["mess"];
						$.post("${ctx}/common/notThroughSecurityCheck?ts=" + new Date().getTime(), mess, function(res) {
							alert(res);
						}, "json");
					} else {
						alert(result);
					}
				},
				"json");
			}
		});
	</script>
</body>
</html>